import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class DemoTestPage2 extends StatefulWidget {
  const DemoTestPage2({Key? key}) : super(key: key);

  @override
  MapPageState createState() => MapPageState();
}

class MapPageState extends State<DemoTestPage2> {
  @override
  void initState() {
    super.initState();
  }

  @override
  dispose() {
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('demi'),
        ),
        body: Column(children: [
          SingleChildScrollView(
            scrollDirection: Axis.horizontal,
            child: Row(children: [
              MaterialButton(
                onPressed: () {
                  showCupertinoDialog(
                      context: context,
                      builder: (buildContext) {
                        return Center(child: const Text('123'));
                      });
                },
                child: const Text('showCupertinoDialog'),
              ),
              MaterialButton(
                onPressed: () {
                  showDatePicker(
                      context: context,
                      initialDate: DateTime.now(),
                      firstDate: DateTime.fromMillisecondsSinceEpoch(0),
                      lastDate:
                          DateTime.fromMillisecondsSinceEpoch(1840979000000));
                },
                child: const Text('showDatePicker'),
              ),
              MaterialButton(
                onPressed: () {
                  showDateRangePicker(
                      context: context,
                      firstDate: DateTime.fromMillisecondsSinceEpoch(0),
                      lastDate:
                          DateTime.fromMillisecondsSinceEpoch(1840979000000));
                },
                child: const Text('showDateRangePicker'),
              ),
              MaterialButton(
                onPressed: () {
                  final snackBar = SnackBar(
                    content: const Text('Yay! A SnackBar!'),
                    action: SnackBarAction(
                      label: 'Undo',
                      onPressed: () {
                        // Some code to undo the change.
                      },
                    ),
                  );

                  // Find the ScaffoldMessenger in the widget tree
                  // and use it to show a SnackBar.
                  ScaffoldMessenger.of(context).showSnackBar(snackBar);
                },
                child: const Text('showSnackBar'),
              ),
            ]),
          )
        ]));
  }
}
